package com.dg.gaming.serverloadbalancer;

import com.dg.gaming.communication.IServerHendler;
import com.dg.dgrmi.net.DGRMIClient;
import com.dg.dgrmi.handler.CallHandler;
import com.dg.gaming.communication.ICommunicator;
import java.io.*;
import com.dg.dgrmi.exception.*;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2009</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class TestClient implements IServerHendler {
    public static void main(String[] args) {
        try {
            TestClient cl = new TestClient();
            CallHandler callHandler = new CallHandler();
            callHandler.exportObject(IServerHendler.class,
                                     cl);
            int thePortIWantToBind = 4455;
            DGRMIClient c = new DGRMIClient("localhost", thePortIWantToBind,
                                            callHandler);
            ICommunicator com = (ICommunicator) c.getGlobal(ICommunicator.class);
            IServerHendler h = com.registerMe(cl);
            h.ping();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    public void ping() {
        System.out.println("ping");
    }

    public void sendData(byte[] bytes, String sessionID) throws Exception {
        System.out.println("sendData");
    }
}
